package com.jl.jlapp.popu;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter.OnItemClickListener;
import com.jl.jlapp.R;
import com.jl.jlapp.adapter.OrderChoosGoodsActivityAdapter;
import com.jl.jlapp.eneity.ActivitysAndCouponsByGoodsMsgModel;
import com.jl.jlapp.eneity.ActivitysAndCouponsByGoodsMsgModel.ResultDataBean.ActivitysBean;
import com.jl.jlapp.utils.CustomLanearLayoutManager;
import java.util.List;

public class OrderChooseGoodsActivityPopu
  extends PopupWindow
{
  int chooseActivityInformationId = 0;
  RelativeLayout chooseGoodsActivityPopup;
  RecyclerView chooseGoodsActivityRecycler_view;
  ImageView closeBtn;
  private OnClickActivityItem onClickActivityItem;
  OrderChoosGoodsActivityAdapter orderChoosGoodsActivityAdapter;
  private TextView shadowPart;
  private View view;
  
  public OrderChooseGoodsActivityPopu(Context paramContext, List<ActivitysAndCouponsByGoodsMsgModel.ResultDataBean.ActivitysBean> paramList, int paramInt)
  {
    super(paramContext);
    this.chooseActivityInformationId = paramInt;
    this.view = ((LayoutInflater)paramContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.order_choose_goods_activity_pop, null);
    this.closeBtn = ((ImageView)this.view.findViewById(R.id.close_btn));
    this.shadowPart = ((TextView)this.view.findViewById(R.id.shadow_part));
    this.chooseGoodsActivityRecycler_view = ((RecyclerView)this.view.findViewById(R.id.choose_goods_activity_recycler_view));
    this.chooseGoodsActivityPopup = ((RelativeLayout)this.view.findViewById(R.id.choose_goods_activity_popup));
    this.chooseGoodsActivityRecycler_view.setLayoutManager(new CustomLanearLayoutManager(paramContext, true));
    this.orderChoosGoodsActivityAdapter = new OrderChoosGoodsActivityAdapter(2131362001, paramList);
    this.orderChoosGoodsActivityAdapter.setChooseId(this.chooseActivityInformationId);
    this.chooseGoodsActivityRecycler_view.setAdapter(this.orderChoosGoodsActivityAdapter);
    this.orderChoosGoodsActivityAdapter.setOnItemClickListener(new OnItemClickListener()
    {
      public void onItemClick(BaseQuickAdapter paramAnonymousBaseQuickAdapter, View paramAnonymousView, int paramAnonymousInt)
      {
        TextView textView = (TextView)paramAnonymousView.findViewById(R.id.activity_information_id);
        OrderChooseGoodsActivityPopu.this.chooseActivityInformationId = Integer.parseInt(textView.getText().toString().trim());
        OrderChooseGoodsActivityPopu.this.orderChoosGoodsActivityAdapter.setChooseId(OrderChooseGoodsActivityPopu.this.chooseActivityInformationId);
        OrderChooseGoodsActivityPopu.this.orderChoosGoodsActivityAdapter.notifyDataSetChanged();
        if (OrderChooseGoodsActivityPopu.this.onClickActivityItem != null)
        {
          OrderChooseGoodsActivityPopu.this.onClickActivityItem.onClickActivityItem(OrderChooseGoodsActivityPopu.this.chooseActivityInformationId);
          OrderChooseGoodsActivityPopu.this.dismiss();
        }
      }
    });
    setContentView(this.view);
    setWidth(-1);
    setHeight(-1);
    setFocusable(true);
    setAnimationStyle(R.style.AnimBottom);
    setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(paramContext,R.color.white)));
    this.closeBtn.setOnClickListener(new OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        OrderChooseGoodsActivityPopu.this.dismiss();
      }
    });
    this.view.setOnTouchListener(new OnTouchListener()
    {
      public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
      {
        int i = OrderChooseGoodsActivityPopu.this.chooseGoodsActivityPopup.getTop();
        int j = (int)paramAnonymousMotionEvent.getY();
        if ((paramAnonymousMotionEvent.getAction() == 1) && (j < i)) {
          OrderChooseGoodsActivityPopu.this.dismiss();
        }
        return true;
      }
    });
  }
  
  public void setOnClickActivityItem(OnClickActivityItem paramOnClickActivityItem)
  {
    this.onClickActivityItem = paramOnClickActivityItem;
  }
  
  public static abstract interface OnClickActivityItem
  {
    public abstract void onClickActivityItem(int paramInt);
  }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/popu/OrderChooseGoodsActivityPopu.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */